from Add_Order import Add_Order
from Approval_Order import Approval_Order
from Pay_Order import Pay_Order
from Download_Jpg import Download_image
from Detail_By_No import Detail_By_No
import _thread
while True:
    orderNo=Add_Order()
    if "dm" in orderNo:
        Approval_status=Approval_Order(orderNo)
        if "dm" in Approval_status:
            Pay_status=Pay_Order(Approval_status)
            if Pay_status=="成功":
                print("订单："+orderNo+",已支付成功")
                # img_url=Detail_By_No(orderNo)
                # if img_url!="获取处方图片路径失败！":
                #     Download_image(img_url)
                # else:
                #     print(img_url)

            else:
                print("订单："+orderNo+"支付失败,订单状态为："+Pay_status)
        else:
            print(Approval_status)
            break
    else:
        print(orderNo)
        break